<!DOCTYPE HTML PUBLIC "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR" debug="true">
	<head>
		<title>Ajax</title>
		<style type="text/css">
			body{
				font-family:Arial, Helvetica, sans-serif;
				font-size:smaller;
				margin:0;
				}
			form{
				border:1px solid red;
				}
			input.text
				{
				font-size:3em;
				font-weight:bold;
				width:90%;
				border:0;
				background:#FFFFEA;
				}
			input.text:hover
				{
				background:#FFFFEA;
				}
			input.text:focus
				{
				background:Navy;
				color:white;
				}
			
			html, body, #result{height:100%;}
			
			#result{
				width:90%;
				overflow:auto;
				padding:10px;
				border:2px solid #CCC;
				line-height:1.6em;		
			}			
			#loader{
				background:red url(loading-icon.gif) no-repeat 10% 50%;
				width:300px;
				height:40px;
				color:white;
				padding:25px 10px 0 5%;
				font-weight:bold;
				position:absolute;
			}
			body.wait{
				cursor:wait;
			}
		</style>
		<script type="text/javascript" src="firebug/firebug.js"></script>
		<script type="text/javascript" src="ajax.js"></script>
		<script type="text/javascript" src="../../../0.Project/String.format/string.js"></script>
		<script language="javascript">
				
				var x = new Ajax("123456");
				x.method="GET";
				x.returnType = "application/json";
				x.url = "http://localhost/AjaxTest/AjaxTest.aspx?op=json";
				//x.timeout = 1;

				/*
			
				onLoad
				onProgress
				onError
				onTimeout
			
				*/
				
				x.onAbort = function(){
					console.log("onAbort", this.request);
				}
		
				x.onTimeout = function(fromServer){
					console.log("onTimeout", fromServer, this.request);
					return false;
				}				
				
				x.onSuccess = function(data){
					console.log("success: ", data, this.header)
				}
				x.onError = function(){
					console.log("onError")
				}
				
				
				function search(){
					window.x.process();
					return false;
				}
			
			
			
			
		</script>
	</head>
	<body>
		<!--<div id="loader">Carregando</div>-->
		<input class="text" type="text" id="parameters" onfocus="this.select()" size="20" maxlength="40" 
				onkeydown="if(event.keyCode==13){search();return false;}return true;" />


		<select id="oselect">
			<option>1</option>
			<option>2</option>
			<option>3</option>
			<option>4</option>
			<option>5</option>
			<option>6</option>
			<option>7</option>
	</body>
</html>